home *** CD-ROM | disk | FTP | other *** search
- /********************************************************* DEFINITION
- DATE: 9/23/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPPictButton
-
- SUPERCLASS: CPPVisualObject
-
- This C++ class manages a button which is drawn with pictures
- rather than a control definition.
-
- ********************************************************************/
-
- #pragma once
-
- #include <CPPVisualObject.h>
-
- #define kUsePicture 1
- #define kUseInvert 2
- #define kUseDarken 3
-
- class CPPPictButton : public CPPVisualObject {
- public:
- CPPPictButton (CPPWindow *itsWindow, short upPictID,
- short downPictID, Point topLeft,
- Boolean isFramed = FALSE,
- Boolean canBeTarget = FALSE,
- Boolean active = FALSE, Boolean visible = TRUE);
- CPPPictButton (CPPWindow *itsWindow, short thePictID,
- Point topLeft, short hiliteMethod,
- Boolean isFramed = FALSE,
- Boolean useWindowFont = FALSE,
- Boolean canBeTarget = FALSE,
- Boolean active = FALSE, Boolean visible = TRUE);
- ~CPPPictButton (void);
-
- virtual char *ClassName (void);
-
- virtual Boolean DoClick (EventRecord *theEvent);
-
- virtual void Activate (Boolean nowActive);
- virtual void MakeVisible (Boolean nowVisible);
- virtual void MoveContent (short newH, short newV);
- virtual void ResizeContent (short newWidth, short newHeight);
- virtual void Draw (void);
- virtual Rect *GetBounds (void);
-
- virtual void DoOnClick (void);
- virtual void EnableButton (Boolean nowEnabled);
-
- private:
- Boolean isEnabled;
- Boolean hasFrame;
- PicHandle upPict, downPict;
- short hiliteType;
-
- Boolean TrackPictButton (Point thePoint);
- void HilightButton (Boolean doHilight);
-
- };